﻿using System.Collections.Generic;
using Contracts.Entities;

namespace Model.Movie
{
    public class WriteMovieItems 
    {
        public void Process(IEnumerable<MovieItem> items)
        {
            var writer = new WriteMovieItem();               
            foreach (var item in items)
            {
                switch (item.SyncState)
                {
                    case SyncState.Updated: writer.Update(item); break;
                    case SyncState.Inserted: writer.Insert(item); break;
                    case SyncState.Deleted: writer.Delete(item); break;
                }
            }
        }     
    }
}
